package controllers;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import services.DeviceModelService;
import models.DeviceModel;

public class DeviceModelController extends BaseController {
	/**
	 * 获取combobox内容
	 *
	 * @Title: getModel 
	 * @return: void
	 */
	public static void getCombobox(){
		List<DeviceModel> models=DeviceModelService.getCombobox();
		List<Map<String,String>> combos=new ArrayList<Map<String,String>>();
		for(DeviceModel model : models){
			Map<String,String> map=new HashMap<String,String>();
			map.put("id", model.modelid);
			map.put("text", model.modelname);
			combos.add(map);
		}
		renderJSON(combos);
	}
}
